var express = require('express');
var router = express.Router();
var path = require('path');
const { use } = require('./users');
var sqlite3 = require('sqlite3').verbose();

/* GET home page. */
router.get('/', function(req, res, next) {
  
  var lng=req.query.val1;
  var lat=req.query.val2;
  console.log("lng:",lng);
  console.log("lat:",lat);
  var db=new sqlite3.Database(path.join(__dirname,"../public/db/col.s3db"));
  kk=__dirname;
  console.log("kk:",kk)
  db.run("insert into collect values (?,?)",lng,lat);
  db.close(function(err){
    //if (err) throw err;
  })
  res.render('TJ', { title: '提交成功' });
});

module.exports = router;
